﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainMaster.master" AutoEventWireup="true"
    CodeFile="ProTypeInfor.aspx.cs" Inherits="BasicInfo_ProTypeInfor" CodeFileBaseClass="Frame.Pages.ActionInfomationEditBasePage" %>

<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2.Linq, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Data.Linq" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script src="../Scripts/ToChineseSpell.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        function CbUser(id) {
            list.SelectAllRowsOnPage(false);
            labppbm.SetText(id);
            $.ajax({
                type: "Post",
                url: "ProTypeInfor.aspx/GetUsers",
                data: "{'ppbm': '" + id + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    list.SelectRowsByKey(data.d);
                },
                error: function (err) {
                    //alert("关联人员获取失败,请重试！");
                    noty({ "text": "关联人员获取失败,请重试！",
                        "layout": "top",
                        "type": "error",
                        "animateOpen": { "height": "toggle" },
                        "animateClose": { "height": "toggle" },
                        "speed": 500,
                        "timeout": 1000,
                        "closeButton": false,
                        "closeOnSelfClick": true,
                        "closeOnSelfOver": false
                    });
                }
            });
        }
        function ShowUser() {
            if (pupControl.IsWindowVisible()) {
                //alert("保存成功！");
                noty({ "text": "负责人保存成功！",
                    "layout": "top",
                    "type": "success",
                    "animateOpen": { "height": "toggle" },
                    "animateClose": { "height": "toggle" },
                    "speed": 500,
                    "timeout": 1000,
                    "closeButton": false,
                    "closeOnSelfClick": true,
                    "closeOnSelfOver": false
                });
                pupControl.Hide()
            }
            else {
                pupControl.Show();
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="MainContent">
    <dx:ASPxRoundPanel ID="MainRoundPanel" runat="server" Width="100%" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
        CssPostfix="Office2010Blue" EnableDefaultAppearance="False" GroupBoxCaptionOffsetX="6px"
        GroupBoxCaptionOffsetY="-19px" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
        <ContentPaddings PaddingBottom="10px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="10px" />
        <HeaderStyle>
            <Paddings PaddingBottom="6px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="3px" />
        </HeaderStyle>
        <PanelCollection>
            <dx:PanelContent runat="server" SupportsDisabledAttribute="True">
            </dx:PanelContent>
        </PanelCollection>
    </dx:ASPxRoundPanel>
    <h3 class="DemoTitle">
        商品品牌基本信息管理
    </h3>
    <div id="DemoArea">
        <dx:ASPxGridView ID="gridView" runat="server" Width="100%" AutoGenerateColumns="False"
            CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
            DataSourceID="LSMDSourceMainProType" KeyFieldName="ppbm" OnRowInserting="gridView_RowInserting"
            OnCellEditorInitialize="gridView_CellEditorInitialize" OnRowUpdating="gridView_RowUpdating">
            <Columns>
                <dx:GridViewDataTextColumn Caption="品牌编码" FieldName="ppbm" VisibleIndex="0" CellStyle-HorizontalAlign="Left"
                    Name="t_ppbm">
                    <PropertiesTextEdit MaxLength="50" Native="true" Width="150px">
                        <ValidationSettings>
                            <RequiredField ErrorText="品牌编号不能为空！" IsRequired="True" />
                        </ValidationSettings>
                    </PropertiesTextEdit>
                    <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                    <CellStyle HorizontalAlign="Left">
                    </CellStyle>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="品牌名称" FieldName="ppmc" VisibleIndex="1" CellStyle-HorizontalAlign="Left"
                    Name="t_ppmc">
                    <PropertiesTextEdit MaxLength="50" Native="true" Width="260px">
                        <ValidationSettings>
                            <RequiredField ErrorText="品牌名称不能为空！" IsRequired="True" />
                        </ValidationSettings>
                    </PropertiesTextEdit>
                    <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                    <CellStyle HorizontalAlign="Left">
                    </CellStyle>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="创建者" FieldName="founder" VisibleIndex="2" CellStyle-HorizontalAlign="Left"
                    Name="t_founder">
                    <PropertiesTextEdit MaxLength="50" Native="true" Width="260px">
                    </PropertiesTextEdit>
                    <EditFormSettings CaptionLocation="Near" Visible="False"></EditFormSettings>
                    <CellStyle HorizontalAlign="Left">
                    </CellStyle>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="创建日期" FieldName="fdate" VisibleIndex="3" CellStyle-HorizontalAlign="Left"
                    Name="t_fdate">
                    <PropertiesTextEdit MaxLength="50" Native="true" Width="260px">
                    </PropertiesTextEdit>
                    <EditFormSettings CaptionLocation="Near" Visible="False"></EditFormSettings>
                    <CellStyle HorizontalAlign="Left">
                    </CellStyle>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="最后修订人" FieldName="editor" VisibleIndex="4" CellStyle-HorizontalAlign="Left"
                    Name="t_editor">
                    <PropertiesTextEdit MaxLength="50" Native="true" Width="260px">
                    </PropertiesTextEdit>
                    <EditFormSettings CaptionLocation="Near" Visible="False"></EditFormSettings>
                    <CellStyle HorizontalAlign="Left">
                    </CellStyle>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="最后修订日期" FieldName="edate" VisibleIndex="5" CellStyle-HorizontalAlign="Left"
                    Name="t_edate">
                    <PropertiesTextEdit MaxLength="50" Native="true" Width="260px">
                    </PropertiesTextEdit>
                    <EditFormSettings CaptionLocation="Near" Visible="False"></EditFormSettings>
                    <CellStyle HorizontalAlign="Left">
                    </CellStyle>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="负责人" Name="t_fzr" VisibleIndex="6">
                    <DataItemTemplate>
                        <a href="javascript:CbUser(' <%# Eval("ppbm")%> ');">负责人</a>
                    </DataItemTemplate>
                    <EditFormSettings Visible="False" />
                </dx:GridViewDataTextColumn>
            </Columns>
            <SettingsEditing EditFormColumnCount="1" Mode="PopupEditForm" PopupEditFormModal="true"
                PopupEditFormHorizontalAlign="WindowCenter" PopupEditFormVerticalAlign="WindowCenter" />
            <Settings ShowFilterRow="True" />
            <SettingsText PopupEditFormCaption="编辑" EmptyDataRow="没有记录" />
            <Images SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                <LoadingPanelOnStatusBar Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                </LoadingPanelOnStatusBar>
                <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                </LoadingPanel>
            </Images>
            <ImagesFilterControl>
                <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                </LoadingPanel>
            </ImagesFilterControl>
            <Styles CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue">
                <Header ImageSpacing="5px" SortingImageSpacing="5px">
                </Header>
                <LoadingPanel ImageSpacing="5px">
                </LoadingPanel>
            </Styles>
            <StylesPager>
                <PageNumber ForeColor="#3E4846">
                </PageNumber>
                <Summary ForeColor="#1E395B">
                </Summary>
            </StylesPager>
            <StylesEditors ButtonEditCellSpacing="0">
                <ProgressBar Height="21px">
                </ProgressBar>
            </StylesEditors>
        </dx:ASPxGridView>
    </div>
    <dx:ASPxPopupControl ID="ASPxPopupControl3" runat="server" ClientInstanceName="pupControl"
        Width="450px" AllowResize="True" HeaderText="负责人" PopupVerticalAlign="WindowCenter"
        PopupHorizontalAlign="WindowCenter" CloseAction="CloseButton" Modal="True" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
        CssPostfix="Office2010Blue" EnableHotTrack="False" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
        <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Web/Loading.gif">
        </LoadingPanelImage>
        <LoadingPanelStyle ImageSpacing="5px">
        </LoadingPanelStyle>
        <ContentCollection>
            <dx:PopupControlContentControl runat="server" SupportsDisabledAttribute="True">
                <table>
                    <tr>
                        <td>
                            品牌编码：
                        </td>
                        <td>
                            <dx:ASPxLabel ID="labppbm" runat="server" ClientInstanceName="labppbm" Text="ASPxLabel">
                            </dx:ASPxLabel>
                        </td>
                    </tr>
                </table>
                <dx:ASPxGridView ID="gvUserList" runat="server" Width="100%" AutoGenerateColumns="False"
                    ClientInstanceName="list" DataSourceID="LSMDSourceMainUsers" KeyFieldName="rybm"
                    CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                    OnCustomCallback="gvUserList_CustomCallback">
                    <Columns>
                        <dx:GridViewCommandColumn ShowInCustomizationForm="True" ShowSelectCheckbox="True"
                            VisibleIndex="0">
                            <HeaderTemplate>
                                <input type="checkbox" onclick="list.SelectAllRowsOnPage(this.checked);" title="全选或取消" />
                            </HeaderTemplate>
                            <HeaderStyle HorizontalAlign="Center" />
                            <ClearFilterButton Visible="True">
                            </ClearFilterButton>
                        </dx:GridViewCommandColumn>
                        <dx:GridViewDataTextColumn Caption="人员编码" FieldName="rybm" Name="t_rybm" ReadOnly="True"
                            ShowInCustomizationForm="True" VisibleIndex="0">
                            <EditFormSettings CaptionLocation="Near" />
                            <CellStyle HorizontalAlign="Left">
                            </CellStyle>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="人员姓名" FieldName="ryxm" Name="t_ryxm" ShowInCustomizationForm="True"
                            VisibleIndex="1">
                            <EditFormSettings CaptionLocation="Near" />
                            <CellStyle HorizontalAlign="Left">
                            </CellStyle>
                        </dx:GridViewDataTextColumn>
                    </Columns>
                    <Settings ShowFilterRow="true" ShowGroupPanel="false" />
                    <Settings ShowVerticalScrollBar="true" />
                    <ClientSideEvents EndCallback="ShowUser" />
                    <Images SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                        <LoadingPanelOnStatusBar Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                        </LoadingPanelOnStatusBar>
                        <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                        </LoadingPanel>
                    </Images>
                    <ImagesFilterControl>
                        <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                        </LoadingPanel>
                    </ImagesFilterControl>
                    <Styles CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue">
                        <Header ImageSpacing="5px" SortingImageSpacing="5px">
                        </Header>
                        <LoadingPanel ImageSpacing="5px">
                        </LoadingPanel>
                    </Styles>
                    <StylesPager>
                        <PageNumber ForeColor="#3E4846">
                        </PageNumber>
                        <Summary ForeColor="#1E395B">
                        </Summary>
                    </StylesPager>
                    <StylesEditors ButtonEditCellSpacing="0">
                        <ProgressBar Height="21px">
                        </ProgressBar>
                    </StylesEditors>
                </dx:ASPxGridView>
                <table width="100%">
                    <tr>
                        <td align="right">
                            <dx:ASPxButton ID="BtnUser" runat="server" Font-Size="10pt" Text="保存" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                Width="60px" AutoPostBack="false" UseSubmitBehavior="false">
                                <ClientSideEvents Click="function(s, e) {
                                list.PerformCallback(labppbm.GetText());
                        }" />
                            </dx:ASPxButton>
                        </td>
                    </tr>
                </table>
            </dx:PopupControlContentControl>
        </ContentCollection>
    </dx:ASPxPopupControl>
    <dx:LinqServerModeDataSource ID="LSMDSourceMainUsers" runat="server" ContextTypeName="DAL.DataClassesDataContext"
        TableName="css_user" />
    <dx:LinqServerModeDataSource ID="LSMDSourceMainProType" runat="server" ContextTypeName="DAL.DataClassesDataContext"
        EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="css_ppdj" />
</asp:Content>
